﻿@model WEB.Models.ProdutoModel

@{
    ViewBag.Title = "Novo";
    Layout = "~/Views/Shared/_Padrao.cshtml";
}

<h2>Novo</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm("Novo", "Produto", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>ObjetoModel</legend>

        <div>
            @Html.DropDownListFor(model => model.idTipo, (IEnumerable<SelectListItem>)ViewData["Tipo"], "-- Selecione o tipo --")
        </div>
        
        <div class="editor-label">
            @Html.LabelFor(model => model.Descricao)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Descricao)
            @Html.ValidationMessageFor(model => model.Descricao)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Preco)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Preco)
            @Html.ValidationMessageFor(model => model.Preco)
        </div>
        
        <div class="editor-label">
            <input type="file" name="flArqImagem" id="flArqImagem"/>
        </div>

        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
